<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>百顺通云-后台代理商详情页面</title>
        <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
        <!-- 公用js文件引入 -->
        <jsp:include page="../../admin/commonCSS.jsp"></jsp:include>
        <style type="text/css">
        	.dialog_changerule .aui_close {
        		display:none;
        	}
        	#rules .input-group {
        		margin-bottom: 30px;
        	}
        	#rules .input-group select {
        		width: 150px;
        	}
        	#rules .input-group:nth-child(1) span{
    			letter-spacing: 0.4em;
        	}
        </style>
    </head>
    <body class="skin-blue">
    	<input type="hidden" id="supplierId" value="${supplierInfo.supplierId}"/>
    	<input type="hidden" id="pstate" value="${supplierInfo.applyState}"/>
    	<input type="hidden" id="applyState" value=""/>
    	<input type="hidden" id="reApplyType" value="${supplierInfo.applyType}"/>
        <!-- 公用头部 -->
        <jsp:include page="../../admin/commonHeader.jsp"></jsp:include>
       
        <div class="wrapper row-offcanvas row-offcanvas-left">
            
            <!-- 公用导航 -->
            <jsp:include page="../../admin/commonMenu.jsp"></jsp:include>

            <!-- Right side column. Contains the navbar and content of the page -->
            <aside class="right-side">
                <!-- Content Header (Page header) -->
                <section class="content-header">
                    <h1>
                        代理商管理
                        <small>代理商详情</small>
                    </h1>
                    <ol class="breadcrumb">
                        <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
                        <li class="active">代理商管理</li>
                    </ol>
                </section>

                <!-- Main content -->
                <section class="content">
                    <!-- Small boxes (Stat box) -->
                    <div class="row fixrowscroll">
                        
                        <!-- table数据 -->
                        <div class="box-body table-responsive">
                            <div class="dataTables_wrapper form-inline fixwrapperscroll" role="grid">
                                <div class="row">
                                    <div class="col-xs-6"></div>
                                    <div class="col-xs-6"></div>
                                </div>
			                	<table class="table table-bordered table-hover dataTable">
									<tbody>
										<tr>
											<td width="20%" class="taright">单位名称：</td>
											<td width="30%"><span>${supplierInfo.belongCompanyName}</span></td>
											<td width="20%" class="taright">联系人：</td>
											<td><span>${supplierInfo.realName}</span></td>
										</tr>
										<tr class="alt">
											<td width="20%" class="taright">联系电话：</td>
											<td width="30%">${supplierInfo.userTel}<span></span>
											</td>
											<td width="20%" class="taright">固定电话：</td>
											<td><span>${supplierInfo.fixationTel}</span></td>
										</tr>
										<tr>
											<td width="20%" class="taright">邮箱：</td>
											<td width="30%"><span>${supplierInfo.userEmail}</span>
											</td>
											<td width="20%" class="taright">公司行业：</td>
											<td><span>${supplierInfo.companyIndustryName}</span></td>
										</tr>
										<tr>
											<td width="20%" class="taright">公司规模：</td>
											<td width="30%"><span>${supplierInfo.companyScaleName}</span>
											</td>
											<td width="20%" class="taright">所在地址：</td>
											<td><span>${supplierInfo.provinceCodeName} ${supplierInfo.cityCodeName} ${supplierInfo.areaCodeName} ${supplierInfo.address}
											</span></td>
										</tr>
										<tr>
											<td width="20%" class="taright">公司简介：</td>
											<td width="30%" colspan="3"><span>${supplierInfo.companyIntroduction}</span>
											</td>
										</tr>
										<tr>
											<td width="20%" class="taright">申请类型：</td>
											<td width="30%"><span>
												 <c:if test="${supplierInfo.applyState == 0}">
												 	<select style="width:160px;height:27px;" id="applyType">
								                    	<option value="1" <c:if test="${supplierInfo.applyType == 1}">selected=selected</c:if>>代理商申请</option>
								                    	<option value="2" <c:if test="${supplierInfo.applyType == 2}">selected=selected</c:if>>市总代申请</option>
								                    	<option value="3" <c:if test="${supplierInfo.applyType == 3}">selected=selected</c:if>>省总代申请</option>
								                    	<option value="4" <c:if test="${supplierInfo.applyType == 4}">selected=selected</c:if>>软件开发商申请</option>
								                    	<option value="5" <c:if test="${supplierInfo.applyType == 5}">selected=selected</c:if>>OEM申请</option>
								                    	<option value="6" <c:if test="${supplierInfo.applyType == 6}">selected=selected</c:if>>销售人员</option>
								                      </select>
												 </c:if>
												 <c:if test="${supplierInfo.applyState == 1||supplierInfo.applyState == 2}">
													 <c:if test="${supplierInfo.applyType == 1}">代理商申请</c:if>
													 <c:if test="${supplierInfo.applyType == 2}">市总代申请</c:if>
													 <c:if test="${supplierInfo.applyType == 3}">省总代申请</c:if>
													 <c:if test="${supplierInfo.applyType == 4}">软件开发商申请</c:if>
													 <c:if test="${supplierInfo.applyType == 5}">OEM商合作</c:if>
													 <c:if test="${supplierInfo.applyType == 6}">销售人员</c:if>
												 </c:if>
				                			</span></td>
											<td width="20%" class="taright">申请时间：</td>
											<td width="30%"><span><fmt:formatDate value="${supplierInfo.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
											</span></td>
										</tr>
										<tr>
											<td width="20%" class="taright">套餐优惠价：</td>
											<td width="30%">
												<c:if test="${supplierInfo.applyState == 0}">
												<select style="width:160px;height:27px;" id="mealPrivilege" name="mealPrivilege">
													<c:forEach begin="10" end="100" step="5" varStatus="status">
								                    	<option value="${status.index / 100}">${status.index}%</option>
								                    </c:forEach>
								                </select>
												</c:if>
												<c:if test="${supplierInfo.applyState == 1}">
													<span id="mPrivilege"><fmt:formatNumber value="${supplierInfo.mealPrivilege * 100}" pattern="#"></fmt:formatNumber>%</span>
												</c:if>
											</td>
											<td width="20%" class="taright">增值应用优惠价：</td>
											<td width="30%">
												<c:if test="${supplierInfo.applyState == 0}">
												<select style="width:160px;height:27px;" id="proPrivilege" name="proPrivilege">
													<c:forEach begin="10" end="100" step="5" varStatus="status">
								                    	<option value="${status.index / 100}">${status.index}%</option>
								                    </c:forEach>
								                </select>
												</c:if>
												<c:if test="${supplierInfo.applyState == 1}">
													<span id="pPrivilege"><fmt:formatNumber value="${supplierInfo.proPrivilege * 100}" pattern="#"></fmt:formatNumber>%</span>
												</c:if>
											</td>
										</tr>
										<tr>
											<td width="20%" class="taright">审核状态：</td>
											<td><span>
											<c:if test="${supplierInfo.applyState==0}">待审核</c:if>
											<c:if test="${supplierInfo.applyState==1}">通过</c:if>
											<c:if test="${supplierInfo.applyState==2}">退回</c:if>
											<c:if test="${supplierInfo.applyState==3}">无效</c:if>
											</span></td>
											<td width="20%" class="taright">有效性：</td>
											<td><span>
											<c:if test="${supplierInfo.isValid == 0||supplierInfo.isValid == null}">无效</c:if>
											<c:if test="${supplierInfo.isValid == 1}">有效</c:if>
											</span></td>
										</tr>
										<c:if test="${supplierInfo.applyState == 2}">
											<tr>
												<td width="20%" class="taright">退回原因：</td>
												<td colspan="3"><span>${supplierInfo.returnReason}</span></td>
											</tr>
										</c:if>
										
									</tbody>
								</table>
								<div id="showPics" class=""> 
									<c:forEach items="${aList}" var="al">
										<a href="${al.attachPath}"><img alt="" src="${al.attachPath}"></a>
									</c:forEach>
								</div>
								<div>
									<c:if test="${supplierInfo.applyState == 2}">
										<button type="button" class="btn btn-primary" disabled="disabled" id="pass">通过</button>
										<button type="button" class="btn btn-primary" disabled="disabled" id="unpass">退回</button>
									</c:if>
									<c:if test="${supplierInfo.applyState == 1 && supplierInfo.isValid ==1}">
										<button type="button" class="btn btn-primary" id="update">变更审核</button>
									</c:if>
									<c:if test="${supplierInfo.applyState == 0}">
										<button type="button" class="btn btn-primary" id="pass">通过</button>
										<button type="button" class="btn btn-primary" id="unpass">退回</button>
									</c:if>
									<a href="javascript:history.back(-1)"><button type="button" class="btn btn-primary">返回</button></a>
								</div>
                            </div>
                        </div>


                    </div><!-- /.row -->
                </section><!-- /.content -->
            </aside><!-- /.right-side -->
        </div><!-- ./wrapper -->

		<script type="text/javascript">
			var currentMenu = 'supplierManager';
		</script>
        <!-- 公用js文件引入 -->
        <jsp:include page="../../admin/commonJs.jsp"></jsp:include>
		
        <script src="/js/admin/supplierManager/supplierManager.js"></script>
        

    </body>
</html>
